From 8fa1555c7886ef3491a23df22eee98eeb8a97c8e Mon Sep 17 00:00:00 2001 From: saper Date: Mon, 26 Oct 2015 23:05:15 +0100 Subject: [PATCH] JavaScriptContentTest: $wgScript != $wgScriptPath Set $wgScript, $wgScriptPath and $wgResourceBasePath to avoid failures when running on a wiki with a non-standard $wgScriptPath. Reported-on: https://lists.wikimedia.org/pipermail/wikitech-l/2015-October/083675.html Change-Id: I8acbcca5449060ff5604bf275f690b53343e706e --- tests/phpunit/includes/content/JavaScriptContentTest.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/phpunit/includes/content/JavaScriptContentTest.php b/tests/phpunit/includes/content/JavaScriptContentTest.php index b97842c43c..a636e564b4 100644 --- a/tests/phpunit/includes/content/JavaScriptContentTest.php +++ b/tests/phpunit/includes/content/JavaScriptContentTest.php @@ -258,7 +258,9 @@ class JavaScriptContentTest extends TextContentTest { public function testUpdateRedirect( $oldText, $expectedText ) { $this->setMwGlobals( array( 'wgServer' => '//example.org', - 'wgScriptPath' => '/w/index.php', + 'wgScriptPath' => '/w', + 'wgScript' => '/w/index.php', + 'wgResourceBasePath' => '/w', ) ); $target = Title::newFromText( "testUpdateRedirect_target" ); @@ -317,7 +319,9 @@ class JavaScriptContentTest extends TextContentTest { public function testGetRedirectTarget( $title, $text ) { $this->setMwGlobals( array( 'wgServer' => '//example.org', - 'wgScriptPath' => '/w/index.php', + 'wgScriptPath' => '/w', + 'wgScript' => '/w/index.php', + 'wgResourceBasePath' => '/w', ) ); $content = new JavaScriptContent( $text ); $target = $content->getRedirectTarget(); -- 2.20.1